import request from '@/utils/request'

export function getContracts(data, offset, limit) {
  return request({
    url: '/contract',
    method: 'get',
    params: {
      userId: data.userId,
      offset: offset,
      limit: limit
    }
  })
}

export function addContract(data) {
  return request({
    url: '/contract',
    method: 'post',
    data
  })
}

export function modifyContract(id, data) {
  return request({
    url: `/contract/${id}`,
    method: 'put',
    data
  })
}

export function deleteContract(id, status) {
  return request({
    url: `/contract/status/${id}?status=${status}`,
    method: 'put'
  })
}
